<template>
  <div class="app-container home">
    <!-- 常用功能 -->
    <el-card class="box-card msrginTop">
      <div slot="header" class="clearfix">
        <div class="in-common-use">常用功能</div>
      </div>
      <el-row :gutter="16">
        <el-col :xs="12" :sm="6" :md="3" :lg="3" :xl="3" v-for="(item, index) in recentMenus" :key="index">
          <div class="grid-content">
            <a :href="item.address">
              <el-card class="box-card" shadow="hover" :style="item.pattern">
                <div class="in-common">
                  <!-- <svg-icon :icon-class="item.icon" class="el-input__icon input-icon font-sz" /> -->
                  <svg class="icon-svg aui-sidebar__menu-icon in-common-size" aria-hidden="true"><use class="in-common-icon" :xlink:href="item.icon"></use></svg>
                  <div class="in-common-name">{{item.application}}</div>
                </div>
              </el-card>
            </a>
          </div>
        </el-col>
      </el-row>
    </el-card>
    <!-- 系统企业概况 -->
    <div class="overview msrginTop">
      <el-row :gutter="16">
        <!-- 系统企业概况 -->
        <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" style="margin-bottom:15px">
          <el-card class="box-card">
            <div slot="header" class="clearfix">
              当前项目统计
            </div>
            <el-row :gutter="16">
              <el-col :xs="24" :sm="24" :md="24" :lg="8" :xl="8">
                <el-card class="box-card overview-card card-bg1" shadow="hover">
                  询价项目：{{totalRfqprojects}}
                </el-card>
              </el-col>
              <el-col :xs="24" :sm="24" :md="24" :lg="8" :xl="8">
                <el-card class="box-card overview-card card-bg2" shadow="hover">
                  样品项目：{{totalSampleprojects}}
                </el-card>
              </el-col>
              <el-col :xs="24" :sm="24" :md="24" :lg="8" :xl="8">
                <el-card class="box-card overview-card card-bg3" shadow="hover">
                  批量项目：{{totalMassprojects}}
                </el-card>
              </el-col>
            </el-row>
          </el-card>
        </el-col>

        <!-- 当前公司概况 -->
        <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" style="margin-bottom:15px" class="eight">
          <el-card class="box-card">
            <div slot="header" class="clearfix">
              当前信息统计
            </div>
            <el-row :gutter="16">
              <el-col :xs="24" :sm="24" :md="24" :lg="8" :xl="8">
                <el-card class="box-card overview-card card-bg1" shadow="hover">
                  客户信息：{{totalCustomers}}
                </el-card>
              </el-col>
              <el-col :xs="24" :sm="24" :md="24" :lg="8" :xl="8">
                <el-card class="box-card overview-card card-bg2" shadow="hover">
                  产品信息：{{totalProductprice}}
                </el-card>
              </el-col>
            </el-row>
          </el-card>
        </el-col>

        <!-- 在线用户 -->
        <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" style="margin-bottom:15px">
          <el-card class="box-card">
            <div slot="header" class="clearfix">
              在线用户：1
            </div>
            <div style="height:400px">
              <div class="box-cell">
                <div class="left-cell">
                  <!-- <div class="left-sculpture">
                    <img class="head-sculpture" src="" alt="头像">
                  </div> -->
                  <div class="welcome">
                    admin,欢迎登录
                  </div>
                </div>
                <div class="right-cell">
                  <el-button type="success" plain style="padding: 4px 7px;">在线</el-button>
                </div>
              </div>
              <div class="box-cell">
                <div class="left-cell">
                  <!-- <div class="left-sculpture">
                    <img class="head-sculpture" src="" alt="头像">
                  </div> -->
                  <div class="welcome">
                    admin,欢迎登录
                  </div>
                </div>
                <div class="right-cell">
                  <el-button type="success" plain style="padding: 4px 7px;">在线</el-button>
                </div>
              </div>
              <div class="box-cell">
                <div class="left-cell">
                  <!-- <div class="left-sculpture">
                    <img class="head-sculpture" src="" alt="头像">
                  </div> -->
                  <div class="welcome">
                    admin,欢迎登录
                  </div>
                </div>
                <div class="right-cell">
                  <el-button type="success" plain style="padding: 4px 7px;">在线</el-button>
                </div>
              </div>
            </div>
          </el-card>
        </el-col>

        <!-- 最近操作记录 -->
        <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" style="margin-bottom:15px">
          <el-card class="box-card">
            <div slot="header" class="clearfix">
              最近操作记录
            </div>
            <div class="operate">
              <ul>
                <li>
                  <div class="round"></div>
                  <p class="time">2022-05-21 17:04:29.000</p>
                  <p>API接口日志记录-编辑系统组织机构</p>
                  <div class="line"></div>
                </li>
                <li>
                  <div class="round"></div>
                  <p class="time">2022-05-21 17:04:29.000</p>
                  <p>API接口日志记录-编辑系统组织机构</p>
                  <div class="line"></div>
                </li>
                <li>
                  <div class="round"></div>
                  <p class="time">2022-05-21 17:04:29.000</p>
                  <p>API接口日志记录-编辑系统组织机构</p>
                  <div class="line"></div>
                </li>
                <li>
                  <div class="round"></div>
                  <p class="time">2022-05-21 17:04:29.000</p>
                  <p>API接口日志记录-编辑系统组织机构</p>
                  <div class="line"></div>
                </li>
                <li>
                  <div class="round"></div>
                  <p class="time">2022-05-21 17:04:29.000</p>
                  <p>API接口日志记录-编辑系统组织机构</p>
                </li>
              </ul>

            </div>
          </el-card>
        </el-col>
      </el-row>
    </div>

  </div>
</template>

<script>
export default {
  name: "Index",
  data() {
    return {
      time:'',
      recentMenus:[
        {
          application:"店铺管理",
          icon:"#icon-tree-table",
          address:`http://localhost:8001/product-productprice#/product-productprice`
          // address:`${window.SITE_CONFIG['apiURL']}/product-productprice`
        },
        {
          application:"人员管理",
          icon:"#icon-peoples",
          address:`http://localhost:8001/product-productprice#/customers-customers`
        },
        {
          application:"日志管理",
          icon:"#icon-tree",
          address:"http://localhost:8001/product-productprice#/projects.rfqprojects-rfqprojects"
        },
        {
          application:"高级配置",
          icon:"#icon-user",
          address:"http://localhost:8001/product-productprice#/projects.sampleprojects-sampleprojects"
        },
        {
          application:"告警管理",
          icon:"#icon-tree-table",
          address:`http://localhost:8001/product-productprice#/product-productprice`
          // address:`${window.SITE_CONFIG['apiURL']}/product-productprice`
        },
        {
          application:"系统管理",
          icon:"#icon-peoples",
          address:`http://localhost:8001/product-productprice#/customers-customers`
        },
      ],
    };
  },
  created () {
    this.getUserTime()
  },
  methods: {
    //获取登录时间
    getUserTime () {
      const now = new Date();
      const year = now.getFullYear(); // 获取当前年份
      const month = now.getMonth() + 1; // 获取当前月份，注意getMonth()返回的是0-11，所以需要加1
      const day = now.getDate(); // 获取当前日期
      this.time = year + "-" + month + "-" + day
    },
  },
};
</script>

<style scoped lang="scss">
.home {
  blockquote {
    padding: 10px 20px;
    margin: 0 0 20px;
    font-size: 17.5px;
    border-left: 5px solid #eee;
  }
  hr {
    margin-top: 20px;
    margin-bottom: 20px;
    border: 0;
    border-top: 1px solid #eee;
  }
  .col-item {
    margin-bottom: 20px;
  }

  ul {
    padding: 0;
    margin: 0;
  }

  font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  color: #676a6c;
  overflow-x: hidden;

  ul {
    list-style-type: none;
  }

  h4 {
    margin-top: 0px;
  }

  h2 {
    margin-top: 10px;
    font-size: 26px;
    font-weight: 100;
  }

  p {
    margin-top: 10px;

    b {
      font-weight: 700;
    }
  }

  .update-log {
    ol {
      display: block;
      list-style-type: decimal;
      margin-block-start: 1em;
      margin-block-end: 1em;
      margin-inline-start: 0;
      margin-inline-end: 0;
      padding-inline-start: 40px;
    }
  }
  .box-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 25px;
  }
  .aui-wrapper .el-card + .el-card{
    margin-top: 15px;
  }
  .in-common {
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
  }
  .aui-sidebar__menu-icon {
    display: inline-block;
    vertical-align: middle;
    width: 24px !important;
    height: 50px;
    margin-right: 5px;
    text-align: center;
    font-size: 16px;
    color: inherit !important;
    -webkit-transition: font-size .3s;
    transition: font-size .3s;
  }
  .in-common .in-common-size {
    font-size: 50px;
  }
  .clearfix {
    padding-bottom: 7px;
    font-size: 18px;
  }
  .msrginTop {
    margin-top: 15px;
  }
  .in-common-icon {
    color: #67e0f5 !important;
  }
  .overview {
    margin-top: 15px;
    .overview-card {
      padding: 1.03em;
      color: #fff;
      font-size: 1.5em;
      background-size: cover;
    }
    .overview-card:hover {
      border-color: transparent;
    }
    .card-bg1 {
      background-image:url()
    }
    .card-bg2 {
      background-image:url()
    }
    .card-bg3 {
      background-image:url()
    }
    .box-cell {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 16px 18px;
    }
    .left-cell{
      display: flex;
      align-items: center;
      .left-sculpture {
        width: 46px;
        height: 46px;
        line-height: 68px;
        font-size: 18px;
        overflow: hidden;
        border-radius: 34px;
        .head-sculpture {
          display: block;
          width: 100%;
          height: 100%;
          object-fit: cover;
        }
      }
      .welcome {
        font-size: 15px;
        margin-left: 12px;
      }
    }
    .right-cell {
      font-size: 12px;
    }
  }

  .operate {
    height: 400PX;
    .round {
      width: 10px;
      height: 10px;
      background-color: #fff;
      border: 2px solid transparent;
      border-radius: 100px;
      border-color:#2d93fc;
    }
    ul{
      li {
        display: flex;
        align-items: center;
        position: relative;
        .time {
          margin: 0 20px;
        }
        .line {
          position: absolute;
          top: 27px;
          left: 4px;
          height: calc(100% - 10px);
          border-left: 2px solid #f0f0f0;
        }
      }
    }
  }
}



</style>

